<!-- doUserReg.php 用于将用户输入的注册信息添加到数据库。 -->
<?php
  
  require_once('inc_admin.php');
  //连接数据库		
  connect();

  if(!empty($_FILES["wyy_pic"]["wyy_name"])){
   	$wyy_pic = uploadfile('wyy_pic',UserPhotoPath,array('jpg','gif','png'));
   }
   else{
   	$wyy_pic='';
   }

  $data = array(
		'wyy_name'=>trim($_POST['wyy_name']),
    'wyy_cid'=>trim($_POST['wyy_title']),
    'wyy_brand'=>trim($_POST['wyy_brand']),
    'wyy_jiajulink'=>trim($_POST['wyy_jiajulink']),
    'wyy_intro'=>trim($_POST['wyy_intro']),
   
  	);

  //执行SQL语句
	$result = add('jiaju',$data);

  if(!$result){
  	echo "添加失败！<br/>";
  	echo "<a href='addjiaju.html'>返回</a>";	  
  }else{	  
   redirect('list.php','添加成功!'); 
  }    
  
?>